home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / interp / perl5.005.tar.gz / perl5.005.tar / perl5.005 / perly_c.diff < prev    next >
Text File  |  1998-07-15  |  12KB  |  444 lines

  1. Index: perly.c
  2. *** perly.c.old    Wed Jun 10 03:48:43 1998
  3. --- perly.c    Wed Jun 10 03:55:10 1998
  4. ***************
  5. *** 7,10 ****
  6. --- 7,18 ----
  7.   #include "perl.h"
  8.   
  9. + #ifdef PERL_OBJECT
  10. + static void
  11. + Dep(CPerlObj *pPerl)
  12. + {
  13. +     pPerl->deprecate("\"do\" to call subroutines");
  14. + }
  15. + #define dep() Dep(this)
  16. + #else
  17.   static void
  18.   dep(void)
  19. ***************
  20. *** 12,82 ****
  21.       deprecate("\"do\" to call subroutines");
  22.   }
  23.   
  24. ! #line 29 "perly.y"
  25. ! typedef union {
  26. !     I32    ival;
  27. !     char *pval;
  28. !     OP *opval;
  29. !     GV *gvval;
  30. ! } YYSTYPE;
  31. ! #line 23 "y.tab.c"
  32. ! #define WORD 257
  33. ! #define METHOD 258
  34. ! #define FUNCMETH 259
  35. ! #define THING 260
  36. ! #define PMFUNC 261
  37. ! #define PRIVATEREF 262
  38. ! #define FUNC0SUB 263
  39. ! #define UNIOPSUB 264
  40. ! #define LSTOPSUB 265
  41. ! #define LABEL 266
  42. ! #define FORMAT 267
  43. ! #define SUB 268
  44. ! #define ANONSUB 269
  45. ! #define PACKAGE 270
  46. ! #define USE 271
  47. ! #define WHILE 272
  48. ! #define UNTIL 273
  49. ! #define IF 274
  50. ! #define UNLESS 275
  51. ! #define ELSE 276
  52. ! #define ELSIF 277
  53. ! #define CONTINUE 278
  54. ! #define FOR 279
  55. ! #define LOOPEX 280
  56. ! #define DOTDOT 281
  57. ! #define FUNC0 282
  58. ! #define FUNC1 283
  59. ! #define FUNC 284
  60. ! #define UNIOP 285
  61. ! #define LSTOP 286
  62. ! #define RELOP 287
  63. ! #define EQOP 288
  64. ! #define MULOP 289
  65. ! #define ADDOP 290
  66. ! #define DOLSHARP 291
  67. ! #define DO 292
  68. ! #define HASHBRACK 293
  69. ! #define NOAMP 294
  70. ! #define LOCAL 295
  71. ! #define MY 296
  72. ! #define OROP 297
  73. ! #define ANDOP 298
  74. ! #define NOTOP 299
  75. ! #define ASSIGNOP 300
  76. ! #define OROR 301
  77. ! #define ANDAND 302
  78. ! #define BITOROP 303
  79. ! #define BITANDOP 304
  80. ! #define SHIFTOP 305
  81. ! #define MATCHOP 306
  82. ! #define UMINUS 307
  83. ! #define REFGEN 308
  84. ! #define POWOP 309
  85. ! #define PREINC 310
  86. ! #define PREDEC 311
  87. ! #define POSTINC 312
  88. ! #define POSTDEC 313
  89. ! #define ARROW 314
  90.   #define YYERRCODE 256
  91.   short yylhs[] = {                                        -1,
  92. --- 20,26 ----
  93.       deprecate("\"do\" to call subroutines");
  94.   }
  95. + #endif
  96.   
  97. ! #line 16 "perly.c"
  98.   #define YYERRCODE 256
  99.   short yylhs[] = {                                        -1,
  100. ***************
  101. *** 1337,1361 ****
  102.   int yyerrflag;
  103.   int yychar;
  104. - short *yyssp;
  105. - YYSTYPE *yyvsp;
  106.   YYSTYPE yyval;
  107.   YYSTYPE yylval;
  108. - short yyss[YYSTACKSIZE];
  109. - YYSTYPE yyvs[YYSTACKSIZE];
  110. - #define yystacksize YYSTACKSIZE
  111.   #line 635 "perly.y"
  112.    /* PROGRAM */
  113. ! #line 1349 "y.tab.c"
  114.   #define YYABORT goto yyabort
  115.   #define YYACCEPT goto yyaccept
  116.   #define YYERROR goto yyerrlab
  117.   int
  118. ! yyparse()
  119.   {
  120.       register int yym, yyn, yystate;
  121.   #if YYDEBUG
  122.       register char *yys;
  123.       extern char *getenv();
  124.   
  125.       if (yys = getenv("YYDEBUG"))
  126.       {
  127. --- 1281,1347 ----
  128.   int yyerrflag;
  129.   int yychar;
  130.   YYSTYPE yyval;
  131.   YYSTYPE yylval;
  132.   #line 635 "perly.y"
  133.    /* PROGRAM */
  134. ! #line 1349 "perly.c"
  135.   #define YYABORT goto yyabort
  136.   #define YYACCEPT goto yyaccept
  137.   #define YYERROR goto yyerrlab
  138. + struct ysv {
  139. +     short* yyss;
  140. +     YYSTYPE* yyvs;
  141. +     int oldyydebug;
  142. +     int oldyynerrs;
  143. +     int oldyyerrflag;
  144. +     int oldyychar;
  145. +     YYSTYPE oldyyval;
  146. +     YYSTYPE oldyylval;
  147. + };
  148. + void
  149. + yydestruct(void *ptr)
  150. + {
  151. +     struct ysv* ysave = (struct ysv*)ptr;
  152. +     if (ysave->yyss) Safefree(ysave->yyss);
  153. +     if (ysave->yyvs) Safefree(ysave->yyvs);
  154. +     yydebug    = ysave->oldyydebug;
  155. +     yynerrs    = ysave->oldyynerrs;
  156. +     yyerrflag    = ysave->oldyyerrflag;
  157. +     yychar    = ysave->oldyychar;
  158. +     yyval    = ysave->oldyyval;
  159. +     yylval    = ysave->oldyylval;
  160. +     Safefree(ysave);
  161. + }
  162.   int
  163. ! yyparse(void)
  164.   {
  165.       register int yym, yyn, yystate;
  166. +     register short *yyssp;
  167. +     register YYSTYPE *yyvsp;
  168. +     short* yyss;
  169. +     YYSTYPE* yyvs;
  170. +     unsigned yystacksize = YYSTACKSIZE;
  171. +     int retval = 0;
  172.   #if YYDEBUG
  173.       register char *yys;
  174. + #ifndef __cplusplus
  175.       extern char *getenv();
  176. + #endif
  177. + #endif
  178. +     struct ysv *ysave;
  179. +     New(73, ysave, 1, struct ysv);
  180. +     SAVEDESTRUCTOR(yydestruct, ysave);
  181. +     ysave->oldyydebug    = yydebug;
  182. +     ysave->oldyynerrs    = yynerrs;
  183. +     ysave->oldyyerrflag    = yyerrflag;
  184. +     ysave->oldyychar    = yychar;
  185. +     ysave->oldyyval    = yyval;
  186. +     ysave->oldyylval    = yylval;
  187.   
  188. + #if YYDEBUG
  189.       if (yys = getenv("YYDEBUG"))
  190.       {
  191. ***************
  192. *** 1370,1373 ****
  193. --- 1356,1369 ----
  194.       yychar = (-1);
  195.   
  196. +     /*
  197. +     ** Initialize private stacks (yyparse may be called from an action)
  198. +     */
  199. +     New(73, yyss, yystacksize, short);
  200. +     New(73, yyvs, yystacksize, YYSTYPE);
  201. +     ysave->yyss = yyss;
  202. +     ysave->yyvs = yyvs;
  203. +     if (!yyvs || !yyss)
  204. +     goto yyoverflow;
  205.       yyssp = yyss;
  206.       yyvsp = yyvs;
  207. ***************
  208. *** 1385,1389 ****
  209.               if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
  210.               if (!yys) yys = "illegal-symbol";
  211. !             printf("yydebug: state %d, reading %d (%s)\n", yystate,
  212.                       yychar, yys);
  213.           }
  214. --- 1381,1385 ----
  215.               if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
  216.               if (!yys) yys = "illegal-symbol";
  217. !             PerlIO_printf(Perl_debug_log, "yydebug: state %d, reading %d (%s)\n", yystate,
  218.                       yychar, yys);
  219.           }
  220. ***************
  221. *** 1395,1404 ****
  222.   #if YYDEBUG
  223.           if (yydebug)
  224. !             printf("yydebug: state %d, shifting to state %d\n",
  225.                       yystate, yytable[yyn]);
  226.   #endif
  227.           if (yyssp >= yyss + yystacksize - 1)
  228.           {
  229. !             goto yyoverflow;
  230.           }
  231.           *++yyssp = yystate = yytable[yyn];
  232. --- 1391,1414 ----
  233.   #if YYDEBUG
  234.           if (yydebug)
  235. !             PerlIO_printf(Perl_debug_log, "yydebug: state %d, shifting to state %d\n",
  236.                       yystate, yytable[yyn]);
  237.   #endif
  238.           if (yyssp >= yyss + yystacksize - 1)
  239.           {
  240. !         /*
  241. !         ** reallocate and recover.  Note that pointers
  242. !         ** have to be reset, or bad things will happen
  243. !         */
  244. !         int yyps_index = (yyssp - yyss);
  245. !         int yypv_index = (yyvsp - yyvs);
  246. !         yystacksize += YYSTACKSIZE;
  247. !         ysave->yyvs = yyvs =
  248. !         (YYSTYPE*)realloc((char*)yyvs,yystacksize * sizeof(YYSTYPE));
  249. !         ysave->yyss = yyss =
  250. !         (short*)realloc((char*)yyss,yystacksize * sizeof(short));
  251. !         if (!yyvs || !yyss)
  252. !         goto yyoverflow;
  253. !         yyssp = yyss + yyps_index;
  254. !         yyvsp = yyvs + yypv_index;
  255.           }
  256.           *++yyssp = yystate = yytable[yyn];
  257. ***************
  258. *** 1436,1445 ****
  259.   #if YYDEBUG
  260.                   if (yydebug)
  261. !                     printf("yydebug: state %d, error recovery shifting\
  262. !  to state %d\n", *yyssp, yytable[yyn]);
  263.   #endif
  264.                   if (yyssp >= yyss + yystacksize - 1)
  265.                   {
  266. !                     goto yyoverflow;
  267.                   }
  268.                   *++yyssp = yystate = yytable[yyn];
  269. --- 1446,1470 ----
  270.   #if YYDEBUG
  271.                   if (yydebug)
  272. !                     PerlIO_printf(Perl_debug_log,
  273. !              "yydebug: state %d, error recovery shifting to state %d\n",
  274. !              *yyssp, yytable[yyn]);
  275.   #endif
  276.                   if (yyssp >= yyss + yystacksize - 1)
  277.                   {
  278. !             /*
  279. !             ** reallocate and recover.  Note that pointers
  280. !             ** have to be reset, or bad things will happen
  281. !             */
  282. !             int yyps_index = (yyssp - yyss);
  283. !             int yypv_index = (yyvsp - yyvs);
  284. !             yystacksize += YYSTACKSIZE;
  285. !             ysave->yyvs = yyvs = (YYSTYPE*)realloc((char*)yyvs,
  286. !             yystacksize * sizeof(YYSTYPE));
  287. !             ysave->yyss = yyss = (short*)realloc((char*)yyss,
  288. !             yystacksize * sizeof(short));
  289. !             if (!yyvs || !yyss)
  290. !             goto yyoverflow;
  291. !             yyssp = yyss + yyps_index;
  292. !             yyvsp = yyvs + yypv_index;
  293.                   }
  294.                   *++yyssp = yystate = yytable[yyn];
  295. ***************
  296. *** 1451,1456 ****
  297.   #if YYDEBUG
  298.                   if (yydebug)
  299. !                     printf("yydebug: error recovery discarding state %d\n",
  300. !                             *yyssp);
  301.   #endif
  302.                   if (yyssp <= yyss) goto yyabort;
  303. --- 1476,1482 ----
  304.   #if YYDEBUG
  305.                   if (yydebug)
  306. !                     PerlIO_printf(Perl_debug_log,
  307. !             "yydebug: error recovery discarding state %d\n",
  308. !             *yyssp);
  309.   #endif
  310.                   if (yyssp <= yyss) goto yyabort;
  311. ***************
  312. *** 1469,1474 ****
  313.               if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
  314.               if (!yys) yys = "illegal-symbol";
  315. !             printf("yydebug: state %d, error recovery discards token %d (%s)\n",
  316. !                     yystate, yychar, yys);
  317.           }
  318.   #endif
  319. --- 1495,1501 ----
  320.               if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
  321.               if (!yys) yys = "illegal-symbol";
  322. !             PerlIO_printf(Perl_debug_log,
  323. !         "yydebug: state %d, error recovery discards token %d (%s)\n",
  324. !         yystate, yychar, yys);
  325.           }
  326.   #endif
  327. ***************
  328. *** 1479,1483 ****
  329.   #if YYDEBUG
  330.       if (yydebug)
  331. !         printf("yydebug: state %d, reducing by rule %d (%s)\n",
  332.                   yystate, yyn, yyrule[yyn]);
  333.   #endif
  334. --- 1506,1510 ----
  335.   #if YYDEBUG
  336.       if (yydebug)
  337. !         PerlIO_printf(Perl_debug_log, "yydebug: state %d, reducing by rule %d (%s)\n",
  338.                   yystate, yyn, yyrule[yyn]);
  339.   #endif
  340. ***************
  341. *** 2263,2267 ****
  342.   { yyval.opval = yyvsp[0].opval; }
  343.   break;
  344. ! #line 2266 "y.tab.c"
  345.       }
  346.       yyssp -= yym;
  347. --- 2290,2294 ----
  348.   { yyval.opval = yyvsp[0].opval; }
  349.   break;
  350. ! #line 2266 "perly.c"
  351.       }
  352.       yyssp -= yym;
  353. ***************
  354. *** 2273,2278 ****
  355.   #if YYDEBUG
  356.           if (yydebug)
  357. !             printf("yydebug: after reduction, shifting from state 0 to\
  358. !  state %d\n", YYFINAL);
  359.   #endif
  360.           yystate = YYFINAL;
  361. --- 2300,2306 ----
  362.   #if YYDEBUG
  363.           if (yydebug)
  364. !             PerlIO_printf(Perl_debug_log,
  365. !         "yydebug: after reduction, shifting from state 0 to state %d\n",
  366. !         YYFINAL);
  367.   #endif
  368.           yystate = YYFINAL;
  369. ***************
  370. *** 2288,2292 ****
  371.                   if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
  372.                   if (!yys) yys = "illegal-symbol";
  373. !                 printf("yydebug: state %d, reading %d (%s)\n",
  374.                           YYFINAL, yychar, yys);
  375.               }
  376. --- 2316,2320 ----
  377.                   if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
  378.                   if (!yys) yys = "illegal-symbol";
  379. !                 PerlIO_printf(Perl_debug_log, "yydebug: state %d, reading %d (%s)\n",
  380.                           YYFINAL, yychar, yys);
  381.               }
  382. ***************
  383. *** 2303,2312 ****
  384.   #if YYDEBUG
  385.       if (yydebug)
  386. !         printf("yydebug: after reduction, shifting from state %d \
  387. ! to state %d\n", *yyssp, yystate);
  388.   #endif
  389.       if (yyssp >= yyss + yystacksize - 1)
  390.       {
  391. !         goto yyoverflow;
  392.       }
  393.       *++yyssp = yystate;
  394. --- 2331,2355 ----
  395.   #if YYDEBUG
  396.       if (yydebug)
  397. !         PerlIO_printf(Perl_debug_log,
  398. !         "yydebug: after reduction, shifting from state %d to state %d\n",
  399. !         *yyssp, yystate);
  400.   #endif
  401.       if (yyssp >= yyss + yystacksize - 1)
  402.       {
  403. !     /*
  404. !     ** reallocate and recover.  Note that pointers
  405. !     ** have to be reset, or bad things will happen
  406. !     */
  407. !     int yyps_index = (yyssp - yyss);
  408. !     int yypv_index = (yyvsp - yyvs);
  409. !     yystacksize += YYSTACKSIZE;
  410. !     ysave->yyvs = yyvs =
  411. !         (YYSTYPE*)realloc((char*)yyvs,yystacksize * sizeof(YYSTYPE));
  412. !     ysave->yyss = yyss =
  413. !         (short*)realloc((char*)yyss,yystacksize * sizeof(short));
  414. !     if (!yyvs || !yyss)
  415. !         goto yyoverflow;
  416. !     yyssp = yyss + yyps_index;
  417. !     yyvsp = yyvs + yypv_index;
  418.       }
  419.       *++yyssp = yystate;
  420. ***************
  421. *** 2314,2321 ****
  422.       goto yyloop;
  423.   yyoverflow:
  424. !     yyerror("yacc stack overflow");
  425.   yyabort:
  426. !     return (1);
  427.   yyaccept:
  428. !     return (0);
  429.   }
  430. --- 2357,2364 ----
  431.       goto yyloop;
  432.   yyoverflow:
  433. !     yyerror("Out of memory for yacc stack");
  434.   yyabort:
  435. !     retval = 1;
  436.   yyaccept:
  437. !     return retval;
  438.   }
  439.